<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- %@ taglib prefix="s" uri="/struts-tags" %> --%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"  %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>二货GO—专注高校二手交易</title>
<link rel="stylesheet" href="member/css/frame.css">
<script type="text/javascript" src="component/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="member/js/frame.js"></script>
<script type="text/javascript">
	var memberId="${sessionScope.existUser.id}";
	function check(){
		if(memberId){
			window.location.href="<%=basePath%>"+"MemberServlet?methodName= + "getCollection" + memberId=memberId;
		}else{
			alert("请先登录。");
			return;
		}
	}
</script>
</head>
<body>
    <input type="hidden" id="existUser" value="${sessionScope.existUser.nickName}" />
	<div class="topHead">
		<div class="topContent">
			<div class="topContent topContentLeft">
			    <a href="#"><img alt="主页logo" src="img/indexImg/homepage.png" title="主页"> 二货GO主页</a>
			    <c:if test="${!empty sessionScope.existUser}">
			        <span class="location">
			            <img alt="所在地" src="img/indexImg/location.png" title="所在地">
			            ${sessionScope.existUser.province}/
			            ${sessionScope.existUser.city}/
			            ${sessionScope.existUser.school}
			        </span>
			    </c:if>
			</div>
			<ul>
		        <c:if test="${empty sessionScope.existUser}">
					<li><a href="member/login.jsp" title="请登录">请登录</a></li>
					<li><a href="member/register.jsp" title="免费注册">免费注册</a></li>
				</c:if>
				<c:if test="${!empty sessionScope.existUser}">
					<li>
					        欢迎您，
					    <a href="member/person.jsp" id="loginName" title="${sessionScope.existUser.nickName}">${fn:substring(sessionScope.existUser.nickName,0,12) }</a>
					    <a href="MemberServlet?methodName='logout'" title="退出">
					        <img class="logout-icon" src="img/indexImg/logout.png" title="退出">
					    </a>
					</li>
				</c:if>
				<li id="contactLi">
					<a href="" title="联系客服">联系客服&nbsp;<img alt="frame-down" class="frame-down-icon" src="img/frame-down.png" /></a>
					<ul class="service" id="service" style="display: none;">
						<li><a href="" title="消费客服">消费客服</a></li>
						<li><a href="" title="卖家客服">卖家客服</a></li>
					</ul>
				</li>
			</ul>
		</div>
	</div>
	<div class="wrapHead">
		<div class="container">
			<div class="logo">
				<span class="logoLeft font" title="二货GO">二货GO</span>&nbsp;&nbsp;<span
					class="logoRight font" style="margin-left: 15px;" title="您的校园二货超市">您的校园二货超市</span>
			</div>
			<div class="navBarLeft">
				<ul>
					<li style="border-bottom: 2px solid black;"><a href="#" title="首页">首页</a></li>
					<li><a href="javascript:void(0);" onclick="check()" title="收藏夹">收藏夹</a></li>
					<li><a href="#" title="感兴趣的">感兴趣的</a></li>
				</ul>
			</div>
			<div class="navBarMiddle"></div>
			<div class="navBarRight">
				<ul>
					<li><a href="member/publish.jsp" title="发布二货">发布二货</a></li>
					<li><a href="#" title="我的二货">我的二货 </a><img alt="" src="img/frame-down.png"
						style="position: relative; top: 3px;">
						<ul style="clear: both; z-index: 1000;" class="myUsed erhuo">
							<li><a href="" title="全部二货">全部二货:&nbsp;&nbsp;0</a></li>
							<li><a href="" title="出售中">出售中:&nbsp;&nbsp;0</a></li>
							<li><a href="" title="已售出">已售出:&nbsp;&nbsp;0</a></li>
						</ul></li>
					<li><a href="#" title="我的消息">我的消息 </a><img alt="" src="img/frame-down.png"
						style="position: relative; top: 3px;">
						<ul class="myMessage erhuo" style="z-index: 1000;">
							<li><a href="" title="新的留言">新的留言:&nbsp;&nbsp;0</a></li>
							<li><a href="" title="我的留言">我的留言:&nbsp;&nbsp;0</a></li>
							<li><a href="" title="收到举报">收到举报:&nbsp;&nbsp;0</a></li>
							<li><a href="" title="我举报的">我举报的:&nbsp;&nbsp;0</a></li>
						</ul></li>
				</ul>
			</div>
			<div class="navLast">
				<div class="searchDiv">
					<form action="CommodityInfoServlet" method="post">
						<input type="text" name="commodityName" placeholder="搜二货" /> 
						<input type="hidden" name="methodName" /> 
						<input type="submit" value="搜&nbsp;&nbsp;索" id="submitInput">
					</form>
				</div>
			</div>
			<%-- <script type="text/javascript">
				$(function(){
					$("#submitInput").click(function(){
						var name=$(this).siblings().val();
						alert(name);
						/* window.location.href="WEB-INF/jsp/commodityList.jsp"; */
					});
				});
			</script> --%>
		</div>
	</div>
</body>
</html>